package tw.com.softleader.book.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tw.com.softleader.book.dao.BookDao;
import tw.com.softleader.book.entity.Book;

@Service
public class BookService {
	
	@Autowired
	private BookDao bookDao;
	
	public List<Book> findAll(){
		return bookDao.getAll();
	}
	
	public Book findById(Long id){
		return bookDao.findById(id);
	}
	
	public void insert(Book book){
		bookDao.insert(book);
	}
	
	public void update(Book book){
		bookDao.update(book);
	}
	
	public void delete(Book book){
		bookDao.delete(book);
	}
	
}
